﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.ComponentModel;


namespace baseClass.Controls
{
    public class gridProjectComment : common.controls.baseDataGridView 
    {
        public enum ColumnNames
        {
            projectCode,comment
        };

        public gridProjectComment()
        {
        }

        public override void LockEdit(bool lockStat)
        {
            base.LockEdit(true); 
        }
        public override void Init()
        {
            base.Init();
            data.baseDS.emProjCommentDataTable dummyTbl = new data.baseDS.emProjCommentDataTable();

            // =============================
            // detailGrid
            // =============================

            // projectCode
            common.controls.DataGridViewTextBoxColumnExt projectCode = new common.controls.DataGridViewTextBoxColumnExt();
            projectCode.Uppercase = true;
            projectCode.DataPropertyName = dummyTbl.projectCodeColumn.ColumnName;
            projectCode.HeaderText = "Mã số";
            projectCode.Name = ColumnNames.projectCode.ToString();
            projectCode.Width = 130;
            projectCode.Visible = false; 

            // notes
            common.controls.DataGridViewTextBoxColumnExt name = new common.controls.DataGridViewTextBoxColumnExt();
            name.DataPropertyName = dummyTbl.commentColumn.ColumnName;
            name.HeaderText = "Đánh giá";
            name.Name = ColumnNames.comment.ToString();
            name.Width = 130;

            this.Columns.Clear();
            this.Columns.AddRange(new DataGridViewColumn[] { projectCode, name});

            this.myAutoFitColumn = ColumnNames.comment.ToString();
            this.AutoFit();
        }

    }
}
